package com.example.weixin_01.test.design_model.responsibility.improve;

/**
 * @author zhenghuisheng
 * @date : 2022/9/16
 * 直接通过一个静态的内部类来实现
 */
public class ImpoveSource {
    //课程名字
    private String courseName;
    //课程ppt
    private String coursePPT;
    //课程视频
    private String courseVideo;
    //课程标题
    private String courseTitle;
    //课程的问题和答案
    private String courseQA;

    @Override
    public String toString() {
        return "ImpoveSource{" +
                "courseName='" + courseName + '\'' +
                ", coursePPT='" + coursePPT + '\'' +
                ", courseVideo='" + courseVideo + '\'' +
                ", courseTitle='" + courseTitle + '\'' +
                ", courseQA='" + courseQA + '\'' +
                '}';
    }

    public ImpoveSource(ImproveCourseBuilder improveCourseBuilder){
        this.courseName = improveCourseBuilder.courseName;
        this.coursePPT = improveCourseBuilder.coursePPT;
        this.courseVideo = improveCourseBuilder.courseVideo;
        this.courseTitle = improveCourseBuilder.courseArticle;
        this.courseQA = improveCourseBuilder.courseQA;
    }


    //开始构造
    public static class ImproveCourseBuilder{

        private String courseName;
        private String coursePPT;
        private String courseVideo;
        private String courseArticle;
        private String courseQA;

        public ImproveCourseBuilder buildCourseName(String courseName){
            this.courseName = courseName;
            return this;
        }

        public ImproveCourseBuilder buildCoursePPT(String coursePPT){
            this.coursePPT = coursePPT;
            return this;
        }

        public ImproveCourseBuilder buildCourseVideo(String courseVideo){
            this.courseVideo = courseVideo;
            return this;
        }

        public ImproveCourseBuilder buildCourseArticle(String courseArticle){
            this.courseArticle = courseArticle;
            return this;
        }

        public ImproveCourseBuilder buildCourseQA(String courseQA){
            this.courseQA = courseQA;
            return this;
        }

        //构建器
        public ImpoveSource build(){
            return new ImpoveSource(this);
        }
    }
}
